<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminUsersTableAndOther extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->string('mobile', 32)->default('')->comment('手机号');
            $table->rememberToken();
            $table->string('image')->nullable()->comment('用户头像');
            $table->string('nickname',32)->default('')->comment('用户昵称');
            $table->timestamp('deleted_at')->nullable();
            $table->timestamps();
        });

        Schema::create('app_releases', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('version_code')->default(0)->comment('版本号');
            $table->string('version_name', 32)->comment('版本名');
            $table->string('path')->default('')->comment('保存路径');
            $table->string('description',500)->default('')->comment('描述');
            $table->tinyInteger('platform')->default(0)->comment('平台:0安卓1苹果默认0');
            $table->boolean('force_update')->default(0)->comment('是否强制更新');
            $table->boolean('state')->default(1)->comment('版本状态默认1');
            $table->timestamp('deleted_at')->nullable();
            $table->timestamps();
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_users');
        Schema::dropIfExists('app_releases');
    }
}
